﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using System.Collections.ObjectModel;
using EnergyConsumptionMonitorSystem.MainWindowTabItem;

namespace EnergyConsumptionMonitorSystem.Converters
{
    public class MainWindowTabItemVMsConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            ObservableCollection<MainWindowTabItemViewModel> tabItemVMs = (ObservableCollection<MainWindowTabItemViewModel>)value;
            ObservableCollection<MainWindowTabItem.MainWindowTabItem> tabItems = new ObservableCollection<MainWindowTabItem.MainWindowTabItem>();
            foreach (MainWindowTabItemViewModel vm in tabItemVMs)
            {
                tabItems.Add(vm.View);
            }
            return tabItems;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
